using System;
using System.Collections.Generic;
using System.Text;
using DTO.PO;

namespace DAO.PO
{
    public class OrderDetailDAO
    {
        // cap nhat chi tiet mua hang` (man` hinh` 1)
        public void InsertPurchaseOrderDetails(OrderDetail orderDetail)
        {
            DataProvider provider = new DataProvider();
            provider.Open();
            string command = "insert into PO_OrderDetail(PONumber, InvtID, Qty, Total) values ("
                + orderDetail.POnumber + "," + orderDetail.InvenId + "," + orderDetail.Quantity + "," + orderDetail.Total + ")";

            provider.ExcuteNonQuery(command);
            provider.Close();
        }

        public void DeleteOrderDetail(int poNumber)
        {
            DataProvider provider = new DataProvider();
            provider.Open();
            string command = "delete from PO_OrderDetail where PONumber = " + poNumber;

            provider.ExcuteNonQuery(command);
            provider.Close();
        }
    }
}
